#ifndef READTHREAD_H
#define READTHREAD_H

#include <QThread>
#include <QWidget>
#include <QEvent>
#include <QMutex>

#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <termios.h>
#include <errno.h>

#define BUFFERLEN 1024
class ReadThread : public QThread
{
    Q_OBJECT
    public:
	ReadThread(int serial_FD);
	~ReadThread();

    protected:
	virtual void run();
	int m_serial;
	int m_aviLen;
	fd_set m_readSet;
    private:
	char m_recvBuf[BUFFERLEN];
	char* m_data;
	int m_index;
    signals:
	void ReceivedData(char*,int);
};
#endif
